package com.senseu;

import com.senseu.config.AppConfig;
import io.appium.java_client.android.AndroidDriver;

import java.time.Duration;
import java.time.temporal.ChronoUnit;

public class AndroidApp {

    public static void start(AndroidDriver driver) {
        driver.activateApp(AppConfig.ANDROID_APP_ID);
    }

    public static void stop(AndroidDriver driver) {
        driver.terminateApp(AppConfig.ANDROID_APP_ID);
    }

    public static void background(AndroidDriver driver) {
        driver.runAppInBackground(Duration.of(10, ChronoUnit.SECONDS));
    }

}
